#define DEBUG
#include <cstdio>

using namespace std;

typedef long long ll;
const int maxn=1000000, mods=998244353;

ll fact[maxn+1], unfact[maxn+1];

ll qpower(ll a, int n) {
  ll s=1;
  for (; n; n>>=1) {
    if (n&1) s=s*a%mods;
    a=a*a%mods;
  }
  return s;
}

void initFact(int n) {
  fact[0] = 1;
  for (int i=1; i<=n; i++) {
    fact[i] = fact[i-1]*i%mods;
  }
  unfact[n] = qpower(fact[n], mods-2);
  for (int i=n; i>0; i--) {
    unfact[i-1] = unfact[i]*i%mods;
  }
}

ll c(int n, int m) {
  if (n<0 || m<0 || n<m) return 0;
  return fact[n]*unfact[m]%mods*unfact[n-m]%mods;
}

ll solve(int n, int k) {
  ll ret = ((k==n/2+1)+c(n-2, k-2)*2+mods-c(n-3, k-3))%mods;
  for (int i=1; i<=n/2-1; i++) {
    ret = (ret+c(n-2*i-3, k-i-3)+c(n-2*i-3, k-2-i)*2%mods)%mods;
  }
  return ret*fact[k]%mods*fact[n-k]%mods;
}

int main() {
  freopen("median.in", "r", stdin);
  freopen("median.out", "w", stdout);

  initFact(maxn);
  int n, k;
  scanf("%d %d", &n, &k);
  printf("%lld", (solve(n, k)-solve(n, k-1)+mods)%mods);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
